package com.project.mapper;

import com.github.pagehelper.PageInfo;
import com.project.bean.ManBean;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;

//声明该接口为一个mapper组件
@Mapper
public interface IManMapper {
//    @Insert("insert into t_man(m_name,m_birthday)values(#{name},#{birthday})")
    void add(ManBean man);
//    @Delete("delete from t_man where pk_manID = #{id}")
    void del(int id);
    @Update("update t_man set m_birthday = #{birthday} where pk_manID = #{id}")
    void update(@Param("id") int id,@Param("birthday") LocalDate birthday);
    @Select("select * from t_man ")
    @ResultMap("manMap")
    List<ManBean> findAll();

    /**
     * 动态条件查询
     * @param name 名字
     * @param start 起始日期
     * @param end 结束日期
     * @return
     */
    List<ManBean> findByItem(@Param("name") String name,@Param("start") LocalDate start,@Param("end") LocalDate end);

}
